﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Cloak.NUnit;
using Cloak.Reflection;
using NUnit.Framework;

namespace Ruleweaver.Rules
{
	public class CreateCheckRule : Behavior
	{
		private MethodInfo _method;
		private CheckRule _checkRule;

		protected override void Given()
		{
			_method = Reflect.Func<ICheckable<int>, Check<int>>(Checkable.IsPositive);
		}

		protected override void When()
		{
			_checkRule = Rule.Check(_method);
		}

		[Then]
		public void MethodIsOriginal()
		{
			Assert.AreEqual(_method, _checkRule.Method);
		}
	}
}